<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="__STATIC__/js/jquery.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <script src="__STATIC__/bootstrap-table/js/bootstrap-table.js"></script>
    <script src="__STATIC__/bootstrap-table/js/bootstrap-table-zh-CN.min.js"></script>
    <script src="__STATIC__/bootstrap-table/js/dropdown.js"></script>
    <link rel="stylesheet" href="__STATIC__/bootstrap-table/css/bootstrap-table.min.css">
    <link rel="stylesheet" href="__STATIC__/bootstrap-table/css/bootstrap.css">
    <script type="text/javascript" src="__STATIC__/x-admin/js/xadmin.js"></script>
    <link rel="stylesheet" href="__STATIC__/x-admin/css/font.css">
    <link rel="stylesheet" href="__STATIC__/x-admin/css/xadmin.css">
</head>
<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="#">业务管理</a>
        <a href="#">客户管理</a>
        <a href="#">培训机构</a>
        <a href="#">编辑信息</a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>

<form class="layui-form" action="" onsubmit="return false" id="up" style="width: 30%;">
    <br>
    <input type="text" value="{$data.id}" hidden name="id">
    <div class="layui-form-item">
        <label class="layui-form-label">机构名</label>
        <div class="layui-input-block">
            <input type="text" name="name"  value="{$data.name}" placeholder="请输入培训机构名称" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">介绍</label>
            <div class="layui-input-block">
                <textarea name="content" placeholder="请输入内容" class="layui-textarea">{$data.content}</textarea>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">合作时间</label>
        <div class="layui-input-block">
            <input type="text" name="title"  value="{$data.create_time}" disabled="true" placeholder="请输入培训机构名" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">详细地址</label>
        <div class="layui-input-block">
            <input type="text" name="address" value="{$data.address}" placeholder="请输入培训机构地址" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">联系人名</label>
        <div class="layui-input-block">
            <input type="text" name="phone_name"  value="{$data.phone_name}"  placeholder="请输入培训机构联系人名" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">联系电话</label>
        <div class="layui-input-block">
            <input type="text" name="phone" value="{$data.phone}" placeholder="请输入培训机构联系电话" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">网址</label>
        <div class="layui-input-block">
            <input type="text" name="url" value="{$data.url}" placeholder="请输入培训机构网址" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">邮箱</label>
        <div class="layui-input-block">
            <input type="text" name="email" value="{$data.email}"  placeholder="请输入培训机构名" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">是否推荐</label>
        <div class="layui-input-block">
           {if $data.is_recommend == 1}
            <input type="radio" name="is_recommend" value="1" title="推荐" checked>
            <input type="radio" name="is_recommend" value="0" title="不推荐" >
            {else}
            <input type="radio" name="is_recommend" value="1" title="推荐">
            <input type="radio" name="is_recommend" value="0" title="不推荐" checked>
            {/if}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">代理人</label>
        <div class="layui-input-block">
            <input type="text" name="title" disabled="true"  value="{$data.get_customer.name}" placeholder="请输入培训机构名" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo" id="sub">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
</body>
</html>
<script>
    $("#sub").click(function(){
        $.ajax({
            data:$("#up").serialize(),
            type:"post",
            url:"{:url('/train/trainMessageUpdate')}",
            dataType:"json",
            success:function(res){
                if(res.code){
                    layer.msg(res.msg,{icon:1,time:2000},function(){
                        $("#adminList").bootstrapTable(('refresh'));
                    });
                    return;
                }else{
                    layer.msg(res.msg,{icon:5,time:2000});
                    return;
                }
            }
        })
    })
</script>